package com.ithero.contentcenter.feignclient;

import com.ithero.contentcenter.configuration.UserCenterFeignConfiguration;
import com.ithero.contentcenter.domain.dto.user.UserAddBonseDTO;
import com.ithero.contentcenter.domain.dto.user.UserDTO;
/*import com.ithero.contentcenter.feignclient.fallback.UserCenterFeignClientFallBack;
import com.ithero.contentcenter.feignclient.fallback.UserCenterFeignClientFallBackFactory;*/
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

//@FeignClient(name = "user-center", configuration = UserCenterFeignConfiguration.class)
@FeignClient(name = "user-center"
        //, fallback = UserCenterFeignClientFallBack.class    // fallback拿不到异常
        //, fallbackFactory = UserCenterFeignClientFallBackFactory.class    // fallbackFactory可以拿到异常
        )
public interface UserCenterFeignClient {

    @GetMapping("/users/{id}")
    UserDTO findById(@PathVariable Integer id);

    @PutMapping("/users/add-bonus")
    UserDTO addBonus(@RequestBody UserAddBonseDTO userAddBonseDTO);
}
